package com.itlong.cloud.equip.operate;

import com.itlong.cloud.POJO.DTO.operate.OperateDeviceManageGetPageDTO;
import com.itlong.cloud.POJO.PO.DeviceRunLogPO;
import com.itlong.cloud.POJO.PO.OperateUserInfoPO;
import com.itlong.cloud.POJO.PO.OperationSpecialLogPO;
import com.itlong.cloud.POJO.VO.operate.OperateDeviceDetailsVO;
import com.itlong.cloud.POJO.VO.operate.OperateDeviceManageInfoAllVO;
import com.itlong.cloud.POJO.VO.operate.OperatePassPercentVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *     运营-项目管理-设备管理服务接口暴露。
 * <desc/>
 *
 * @createDate 2019/01/18.
 */
@FeignClient(name = "equip-service")
public interface IOperateDeviceManageServiceClient {

    /**
     * <desc>
     *      分页获取设备信息。
     * <desc/>
     *
     * @param  dto 参数请求对象
     * @return
     * @author Qiang.S
     * @createDate 2019/01/18
     */
    @RequestMapping(path = "/operate/project/deviceManage/getDeviceByPage" ,method = RequestMethod.POST)
    OperateDeviceManageInfoAllVO getDeviceByPage(@RequestBody OperateDeviceManageGetPageDTO dto) throws Exception;

    /**
     * <desc>
     *      获取每个设备所占比例及统计在线与离线设备
     * </desc>
     *
     * @param
     * @return
     * @Author Zhu.yj
     * @createDate  2019/10/28
     */
    @RequestMapping(path ="/operate/project/deviceManage/getOperateDeviceInfo",method = RequestMethod.POST)
    OperateDeviceManageInfoAllVO getOperateDeviceInfo() throws Exception;

    /**
     * <desc>
<<<<<<< HEAD
     *      修改设备的状态 删除、恢复
     * </desc>
     *
     * @param dto 参数DTO
     * @return
     * @author Juguang.S
     * @createDate 2020/12/02
     */
    @RequestMapping(path ="/operate/project/deviceManage/modifyDeviceStatus",method = RequestMethod.POST)
    void modifyDeviceStatus(@RequestBody OperateDeviceManageGetPageDTO dto) throws Exception;

    /**
     * <desc>
     *      获取设备日志运行信息
     * </desc>
     *
     * @param runLogId 设备运行日志ID
     * @return DeviceRunLogPO
     * @author caoshuai
     * @createDate 2020/11/16 11:04
     */
    @RequestMapping(path ="/operate/project/deviceManage/getDeviceRunLogInfo",method = RequestMethod.POST)
    DeviceRunLogPO getDeviceRunLogInfo(@RequestParam("runLogId") String runLogId);

    /**
     * <desc>
     *      删除运行日志
     * </desc>
     *
     * @param runLogId 运行日志逻辑ID
     * @return Object
     * @author caoshuai
     * @createDate 2020/11/16 13:40
     */
    @RequestMapping(path ="/operate/project/deviceManage/delRunLog",method = RequestMethod.POST)
    Integer delRunLog(@RequestParam("runLogId") String runLogId);

    /**
     * <desc>
     *      运行日志列表
     * </desc>
     *
     * @param deviceUnique 设备ID
     * @return Object
     * @author caoshuai
     * @createDate 2020/11/16 13:40
     */
    @RequestMapping(path ="/operate/project/deviceManage/getRunLogInfoPage",method = RequestMethod.POST)
    Map<String,Object> getRunLogInfoPage(@RequestParam("deviceUnique") String deviceUnique,@RequestParam("pageSize") int pageSize,
                                         @RequestParam("currentPage") int currentPage, @RequestParam("orderRule") String orderRule);

    /**
     * <desc>
     *      设备重启业务
     * </desc>
     *
     * @param deviceUnique 设备ID
     * @return Object
     * @author caoshuai
     * @createDate 2020/11/16 13:40
     */
    @RequestMapping(path ="/operate/project/deviceManage/restartDevice",method = RequestMethod.POST)
    Integer restartDevice(@RequestParam("deviceUnique") String deviceUnique,  @RequestParam(value = "deviceType", required = false) String deviceType) throws Exception;

    /**
     * <desc>
     *      获取设备业务
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author caoshuai
     * @createDate 2020/11/25 15:34
     */
    @RequestMapping(path ="/operate/project/deviceManage/getDeviceLog",method = RequestMethod.POST)
    Integer getDeviceLog(@RequestParam("deviceUnique") String deviceUnique, @RequestParam(value = "deviceId", required = false) String deviceId,  @RequestParam(value = "deviceType", required = false) String deviceType) throws Exception;

    /**
     * <desc>
     *      获取详情
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/11/25 9:23
     */
    @RequestMapping(path ="/operate/project/deviceManage/getDeviceDetails",method = RequestMethod.POST)
    OperateDeviceDetailsVO getDeviceDetails(@RequestParam("deviceUnique")String deviceUnique);


    /**
     * <desc>
     *      获取分页设备在线状态变更日志
     * </desc>
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/11/25 9:23
     */
    @RequestMapping(path ="/operate/project/deviceManage/getDeviceOnlineStatusAlterLogPage",method = RequestMethod.POST)
    Page getDeviceOnlineStatusAlterLogPage(@RequestParam("deviceUnique") String deviceUnique, @RequestParam("pageSize") int pageSize, @RequestParam("currentPage") int currentPage);

    /**
     * <desc>
     *      保存操作日志信息
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/12/14 11:30
     */
    @RequestMapping(path ="/operate/project/deviceManage/saveOperationSpecialLog",method = RequestMethod.POST)
    Integer saveOperationSpecialLog(@RequestBody OperationSpecialLogPO operationSpecialLog) throws Exception;

    /**
     * <desc>
     *     获取用户信息
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2020/12/14 11:30
     */
    @RequestMapping(path ="/operate/project/deviceManage/getOperateUserPO",method = RequestMethod.POST)
    OperateUserInfoPO getOperateUserPO(@RequestParam("myUserName") String myUserName);

    /**
     * <desc>
     *      获取设备的开门方式占比
     * </desc>
     *
     * @param deviceUnique 设备唯一码
     * @return
     * @Author Zhu.yj
     * @createDate  2020/12/23
     */
    @PostMapping("/operate/project/deviceManage/getOpenPercent")
    List<OperatePassPercentVO> getOpenPercent(@RequestParam("deviceUnique") String deviceUnique) throws Exception;


    @PostMapping("/operate/project/deviceManage/getPushCloudChangeLog")
    Map<String, Object> getPushCloudChangeLog(Map<String, Object> params);
    /**
     * <desc>
     *      开始从设备端主动获取日志
     * </desc>
     *
     *
     * @author maju
     * @createDate 2021/4/27
     */
    @PostMapping("/operate/project/deviceManage/getDeviceLogByTask")
    void getDeviceLogByTask();
    /**
     * <desc>
     *      开始从设备端主动下载日志
     * </desc>
     *
     *
     * @author maju
     * @createDate 2021/4/27
     */
    @PostMapping("/operate/project/deviceManage/downloadDeviceLogByTask")
    void downloadDeviceLogByTask();

}
